﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices; //DllImport

namespace WiiMouseLib
{
    class User32DLL
    {
        public const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;
        public const UInt32 MOUSEEVENTF_LEFTUP = 0x0004;
        public const UInt32 MOUSEEVENTF_MIDDLEDOWN = 0x0020;
        public const UInt32 MOUSEEVENTF_MIDDLEUP = 0x0040;
        public const UInt32 MOUSEEVENTF_MOVE = 0x0001;
        public const UInt32 MOUSEEVENTF_ABSOLUTE = 0x8000;
        public const UInt32 MOUSEEVENTF_RIGHTDOWN = 0x0008;
        public const UInt32 MOUSEEVENTF_RIGHTUP = 0x0010;

        [DllImport("User32.dll")]
        public static extern void mouse_event(
              UInt32 dwFlags, // motion and click options
              UInt32 dx, // horizontal position or change
              UInt32 dy, // vertical position or change
              UInt32 dwData, // wheel movement
              IntPtr dwExtraInfo // application-defined information
        );

        [DllImport("User32.Dll")]
        public static extern long SetCursorPos(int x, int y);

        [DllImport("User32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool GetCursorPos(out Point lpPoint);

        [DllImport("User32.Dll")]
        public static extern bool ClientToScreen(IntPtr hWnd, ref Point point);

        [StructLayout(LayoutKind.Sequential)]
        public struct Point
        {
            public int x;
            public int y;
        }
    
    }

}
